package cn.edu.scau.cmi.linhuanrui.composite.consistent;

import java.util.Set;

public class ConsitentPerson extends ConsitentOrganization {
	public ConsitentPerson(String name) {
		super(name);
	}

	public void addChild(ConsitentOrganization child) {
		System.out.println("对不起，该节点是叶节点，不能添加子节点");
	}

	public void deleteChild(ConsitentOrganization child) {
		System.out.println("对不起，该节点是叶节点，没有子节点可以删除删除");
	}

	public ConsitentOrganization getParent() {
		return this.parent;
	}

	public Set<ConsitentOrganization> getChildren() {
		System.out.println("对不起，该节点是叶节点，没有子节点");
		return null;
	}

	public void show(int level) {
		if (level == 0) {
			System.out.println(name);
		} else {
			for (int i = 0; i < level; i++) {
				System.out.print("\t");
			}
			System.out.println(name);
		}
	}
}
